#ifndef _EXECUTE_H_
#define _EXECUTE_H_

#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O>
#include <opencv2/imgproc/imgproc.hpp>  // cvtColor()
#include <iostream>
#include <string.h>
#include <cvblob.h>
#include "getBackground.h"
#include "Object.h"
#include "MultiObject.h"

using namespace std;
using namespace cv;
using namespace cvb;

class Execute{
private:
	Object* allObject;
	MultiObject* multiObject; 
	Mat frame;
	Mat binaryImage;

	string path;
	bool firstTimes;
	int numObject;
	
	//Declare the structure for the background subtraction
	CvGaussBGStatModelParams paramMoG;
	CvBGStatModel *bkgdMdl;
	IplImage * binaryForeground;


public:
	Execute();
	~Execute();
	void Tracking();
private:
	void getPath(string &path, int fr);
	void initBackground();
	void getBinaryImage(IplImage& binary);
	void getBlobs(IplImage &binary, CvBlobs &blobs);
	void getObjects(Object* allBlob, const CvBlobs &blobs);
};

#endif